﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@RenderPage("~/Views/Shared/_Header.cshtml")
<div class="sidebar-max" id="container">
    <!-- #sidebar: Sidebar -->
    <div id="sidebar" class="fixed">

        <div class="search-mini-wrapper">
            <form action="#" class="search-mini">
                <input name="search" type="text" placeholder="Search..." />
                <button type="submit">
                    <i class="icon-search"></i>
                </button>
            </form>
        </div>

        <!-- ul.sidebar-menu: Sidebar Menu -->
        <script type="text/template" id="tmplSilder">
            <ul class="sidebar-menu on-click" id="main-menu">
                <li class="active">
                    <div class="sidebar-menu-item-wrapper">
                        <a href="<#= obj.Location #>">
                            <i class="icon-home"></i>
                            <span>首页</span>
                        </a>
                    </div>
                </li>
                <# for(var i = 0,iLen = obj.Childs.length; i < iLen; i++) { #>
                    <li class="parent inactive">
                        <div class="sidebar-menu-item-wrapper">
                            <a href="#">
                                <i class="<#= obj.Childs[i].Icon #>"></i>
                                <span><#= obj.Childs[i].Name #></span>
                            </a>
                            <ul>
                            <# for(var j = 0,jLen = obj.Childs[i].Childs.length; j < jLen; j++) { #>
                                <li>
                                    <a href="<#= obj.Childs[i].Childs[j].Childs.length == 0 ? obj.Childs[i].Childs[j].Location : '' #>"><#= obj.Childs[i].Childs[j].Name #></a>
                                    <ul>
                                    <# for(var k = 0,kLen = obj.Childs[i].Childs[j].Childs.length; k < kLen; k++) { #>
                                        <li>
                                            <a href="<#= obj.Childs[i].Childs[j].Childs[k].Location #>">
                                                <span><#= obj.Childs[i].Childs[j].Childs[k].Name #></span>
                                            </a>
                                        </li>
                                    <# } #>
                                    </ul>
                                </li>
                            <# } #>
                            </ul>
                        </div>
                    </li>
                <# } #>
            </ul>
        </script>
        <!-- /ul.sidebar-menu: Sidebar Menu -->

        <a href="#" id="sidebar-resizer">
            <i class="min icon-resize-small"></i>
            <i class="max icon-resize-full"></i>
        </a>

    </div>
    <!-- /#sidebar: Sidebar -->

    <div id="content">
        <script type="text/template" id="tmplNavbar">
            <ol class="breadcrumb fixed">
                <li><span class="glyphicon glyphicon-flag"></span></li>
                <# for(var i = 0, len = obj.length; i < len; i++) { #>
                    <li <# if(i == len - 1) { #>class="active">
                        <#= obj[i].Name #>
                        <# } else { #>>
                        <a href="<#= obj[i].Location #>"><#= obj[i].Name #></a>
                        <# } #>
                    </li>
                <# } #>
            </ol>
        </script>
       
        <div class="container">
            @RenderBody()
        </div>
        @RenderPage("~/Views/Shared/_Footer.cshtml")
    </div>
</div>

@section Styles{
    <!-- Theme Styles -->
    @Stylesheet.Render("bootstrap.theme.origin")
    @Stylesheet.Render("/assets/css/theme.metro.css")
    <!-- /Theme Styles -->
    @RenderSection("Styles", required: false)
}

@section Scripts{
    <!-- Theme Scripts -->
    @Javascript.Render("/assets/js/madmin.js")
    <!-- Helper -->
    @Javascript.Render("/assets/js/helper.js?v=1.0.0")

    @RenderSection("Scripts", required: false)

    @Javascript.Render("/assets/js/sitemap.js")
    <script type="text/javascript">
        $(function () {
            var path = window.location.pathname.split('/')[1];
            SiteMap.load(path);
            SiteMap.render('tmplSilder');
            SiteMap.renderToCurrent('tmplNavbar');
            madmin.init();
        });
    </script>
}